home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Form & Validation / select-all.izs < prev    next >
Text File  |  2005-08-29  |  1KB  |  56 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>"Select-all" form element script
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This script allows you to add a "select all": feature to your form <textarea>s, whereby visitors can easily highlight the containing content with a click on a link. 
  7. <!/DESCRIPTION> 
  8.  
  9. <!CATEGORY>form and form validation<!/CATEGORY>
  10.  
  11. <!SCRIPT>
  12. <!-- START OF SCRIPT -->
  13. <script language="Javascript">
  14. <!--
  15.  
  16. function selectAll(theField) {
  17. var tempval=eval("document."+theField)
  18. tempval.focus()
  19. tempval.select()
  20. }
  21. //-->
  22. </script>
  23.  
  24.  
  25.  
  26. <form name="test">
  27. <a href="javascript:selectAll('test.select1')">Select All</a><br>
  28. <textarea name="select1" rows=10 cols=20>This is some text. This is some text. This is some text. This is some text.</textarea>
  29. </form>
  30. <!-- END OF SCRIPT -->
  31. <!/SCRIPT>
  32.  
  33. <!PREVIEW>
  34. <!-- START OF SCRIPT -->
  35. <script language="Javascript">
  36. <!--
  37.  
  38. function selectAll(theField) {
  39. var tempval=eval("document."+theField)
  40. tempval.focus()
  41. tempval.select()
  42. }
  43. //-->
  44. </script>
  45.  
  46.  
  47.  
  48. <form name="test">
  49. <a href="javascript:selectAll('test.select1')">Select All</a><br>
  50. <textarea name="select1" rows=10 cols=20>This is some text. This is some text. This is some text. This is some text.</textarea>
  51. </form>
  52.  
  53. <!-- END OF SCRIPT -->
  54. <!/PREVIEW>
  55.  
  56. <!RELATED>NONE<!/RELATED>